<script type="text/javascript">
	$(document).ready(function(){
		$('strong.show').click(function(e){
			e.preventDefault();
			var id = $(this).parents('tr').attr('class');
			$('tr.child_' + id).toggle();
		});
	});
</script>
<?php
	$ssFilter = $this->arrParam['ssFilter'];
	$langTmp = $ssFilter['lang'];
	$lang = '';
	if(!empty($langTmp)){
		$lang = '/lang/' . $langTmp;
	} 
?>

<form name="appForm" method="post" action="">
                        <?php echo $this->render('toolbarComments.php')?>
                        <div class="clr"></div>
                        <?php echo $this->render('sublink.php')?>
                        <!-- BEGIN: CONTENT -->
                        <div id="element-box">
                            <div class="t">
                                <div class="t">
                                    <div class="t"></div>
                                </div>
                            </div>
                            <div class="m">
                                <!-- BEGIN: ELEMENT BOX -->
                                <table class="adminlist">
                                    <thead>
                                        <tr>
                                            <th width="43" >
                                            	<input type="checkbox" name="checkbox" id="checkbox" onclick="checkedAll()">
                                           	</th>
                                            <th><?php echo $this->translate('Title')?></th>
                                            <th width="120"><?php echo $this->translate('Full name')?></th>
                                            <th><?php echo $this->translate('Email')?></th>
                                            <th width="250"><?php echo $this->translate('Product name')?></th>
                                            <th width="89"><?php echo $this->translate('Status')?></th>
                                            <th width="86"><?php echo $this->translate('Order')?></th>
                                            <th width="77"><?php echo $this->translate('Created')?></th>
                                            <th width="90"><?php echo $this->translate('Control')?></th>
                                            <th width="34">ID</th>
                                        </tr>
                                    </thead>
									<?php 
										$i = 0;
										foreach($this->Items as $key => $val){
											$id 			= $val['id'];
											$title 			= $val['title'];
											$full_name 		= $val['user_name'];
											$email 			= $val['email'];
											$product_name 	= $val['product_name'];
											$status 		= $val['status'];
											$created 		= $val['created'];
											if($status == 1){	
												$linkStatus = $this->baseUrl($this->currentController . '/status/type/0/id/' . $id);											
												$status = $this->cmsAjaxButton('ajax-active-item', 'Active', 'Inactive', $linkStatus, $id);
											}else{
												$linkStatus = $this->baseUrl($this->currentController . '/status/type/1/id/' . $id);
												$status = $this->cmsAjaxButton('ajax-inactive-item', 'Inactive', 'Active', $linkStatus, $id);
											}
											$order 			= $this->formText('order[' . $val['id'] . ']' ,$val['order'],array('style'=>'width: 30px; text-align: center;'));
											
											$linkInfo		= $this->baseUrl($this->currentController . '/info/id/' . $id . $lang);											
											$btnInfo		= $this->cmsIconButton('View Item',$this->imgUrl . '/icon_info.png',$linkInfo);
											$linkEdit		= $this->baseUrl($this->currentController . '/edit/id/' . $id . $lang);
											$btnEdit		= $this->cmsIconButton('Edit Item',$this->imgUrl . '/icon_edit.png',$linkEdit);
											$linkDelete		= $this->baseUrl($this->currentController . '/delete/id/' . $id . $lang);
											$btnDelete =  $this->cmsAjaxButton('ajax-delete-item', 'Delete Item', 'Delete', $linkDelete, $id);
											$strIconButton	= $btnInfo . ' ' . $btnEdit . ' ' . $btnDelete;
											$cid			= $this->formCheckbox('cid[]',$val['id']);
									?>
                                    <tr class="<?php echo $tmp;?>">						
                                        <td align="center"><?php echo $cid;?></td>
                                        <td align="left"><a href="<?php echo $linkEdit?>"><?php echo $title;?></a></td>
                                        <td align="left"><?php echo $full_name;?></td>
                                        <td align="left"><?php echo $email;?></td>
                                        <td align="left"><?php echo $product_name;?></td>
                                        <td align="center"><?php echo $status;?></td>
                                        <td align="center"><?php echo $order;?></td>
                                        <td align="center"><?php echo $created;?></td>                                        
                                        <td align="center"><?php echo $strIconButton;?></td>
                                        <td align="center"><?php echo $id;?></td>
                                    </tr>
                                    <?php 
										}
                                    ?>
                                    <!-- BEGIN: PAGINATION (FOOT) -->
                                    <tfoot>
                                        <tr>
                                            <td colspan="19">
                                                <div class="container">
                                                    <div class="pagination">
                                                        <?php 
                                                        	$currentUrl = $this->baseUrl($this->currentController . '/index');
                                                        	echo $this->paginationControl($this->panigator,'Sliding','pagination.phtml',array('currentUrl'=>$currentUrl));
                                                        ?>
                                                        <div class="limit"></div>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>					
                                    </tfoot>				
                                    <!-- END: PAGINATION (FOOT) -->
                                </table>
                                <!-- Area 4: In du lieu lay tu database - End -->
                                <!-- END: ELEMENT BOX -->	
                              <div class="clr"></div>
                            </div>
                            <div class="b">
                                <div class="b">
                                    <div class="b"></div>
                                </div>
                            </div>
                        </div>
                        <!-- END: 	CONTENT -->
                    </form>